﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace Site.Models
{

    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Mot de passe actuel")]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "La chaîne {0} doit comporter au moins {2} caractères.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Nouveau mot de passe")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirmer le nouveau mot de passe")]
        [Compare("NewPassword", ErrorMessage = "Le nouveau mot de passe et le mot de passe de confirmation ne correspondent pas.")]
        public string ConfirmPassword { get; set; }
    }
    
    public class ChangeEmailModel
    {
        /*[Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "E-mail actuel")]
        public string OldEmail { get; set; }*/

        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Nouvel E-mail")]
        public string NewEmail { get; set; }

    }

    public class LogOnModel
    {
        [Required]
        [Display(Name = "Nom d'utilisateur")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Mot de passe")]
        public string Password { get; set; }

        [Display(Name = "Mémoriser le mot de passe ?")]
        public bool RememberMe { get; set; }
    }

    public class RegisterModel
    {
        [Required]
        [Display(Name = "Nom d'utilisateur")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Adresse de messagerie")]
        public string Email { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "La chaîne {0} doit comporter au moins {2} caractères.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Mot de passe")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirmer le mot de passe")]
        [Compare("Password", ErrorMessage = "Le mot de passe et le mot de passe de confirmation ne correspondent pas.")]
        public string ConfirmPassword { get; set; }

        
        [Display(Name = "Ville")]
        public string City { get; set; }

        
        [Display(Name = "Pays")]
        public string Country { get; set; }


        [Required(ErrorMessage = "La date de naissance est requise.")]
        [DataType(DataType.Date, ErrorMessage = "Veuillez entrer une date valide au format jj/mm/aaaa.")]
        [Display(Name = "Date de naissance")]
        public string Birthday { get; set; }

        [Display(Name = "Avatar")]
        public string Avatar { get; set; }
    }

    public class EditModel
    {
        public Guid UserId { get; set; }
        
        [Required]
        [Display(Name = "Nom d'utilisateur")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Adresse de messagerie")]
        public string Email { get; set; }
                
        [Display(Name = "Ville")]
        public string City { get; set; }


        [Display(Name = "Pays")]
        public string Country { get; set; }
        
        [Required(ErrorMessage = "La date de naissance est requise.")]
        [DataType(DataType.Date, ErrorMessage = "Veuillez entrer une date valide au format jj/mm/aaaa.")]
        [Display(Name = "Date de naissance")]
        public DateTime Birthday { get; set; }

        [DataType(DataType.ImageUrl)]
        [Display(Name = "Avatar")]
        public string Avatar { get; set; }
    }
}
